const { DataTypes } = require('sequelize')
const sequelize = require('../dao/dbConnect')

// 定义数据模型
module.exports = sequelize.define('blogType', {
  id: {
    type: DataTypes.UUID,
    defaultValue: DataTypes.UUIDV4,
    primaryKey: true,
    allowNull: false
  },
  name: {
    type: DataTypes.STRING,
    allowNull: false
  },
  articleCount: {
    type: DataTypes.INTEGER,
    allowNull: false,
    defaultValue: 0
  },
  order: {
    type: DataTypes.INTEGER,
    allowNull: false
  }
}, {
  freezeTableName: true,
  createdAt: false,
  updatedAt: false
})